<template>
	<view>
		<view class="">
			<u-notice-bar mode="horizontal" :list="list"></u-notice-bar>
		</view>
		<view class="">
			<u-image width="100%" height="400rpx" src="http://localhost:3000/static/logoimg/bgc.jpg"></u-image>
		</view>
		<view class="bbody">
			<u-grid :border="false" col="3" hover-class="true">
				<u-grid-item @click="topage('message')">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="'../../../static/paimg/通知.png'" :size="60"></u-icon>
					<text class="grid-text">通知</text>
				</u-grid-item>
				<u-grid-item @click="topage('warning')">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="'../../../static/paimg/预警.png'" :size="60"></u-icon>
					<text class="grid-text">库存预警</text>
				</u-grid-item>
				<u-grid-item @click="topage('buyreport')">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="'../../../static/paimg/统计分析.png'" :size="60"></u-icon>
					<text class="grid-text">数据报表</text>
				</u-grid-item>
			</u-grid>
			<u-grid :border="false" col="3" hover-class="true">
				<u-grid-item @click="towar()">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="'../../../static/paimg/仓库.png'" :size="60"></u-icon>
					<text class="grid-text">仓库信息</text>
				</u-grid-item>
				<u-grid-item @click="tosup()">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="'../../../static/paimg/供应商.png'" :size="60"></u-icon>
					<text class="grid-text">供应商信息</text>
				</u-grid-item>
				<u-grid-item @click="tostock('stockmenk')">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="'../../../static/paimg/库存.png'" :size="60"></u-icon>
					<text class="grid-text">库存信息</text>
				</u-grid-item>
			</u-grid>
		</view>
		<view><u-tabbar active-color="#17abe3" :list="tabBerList" ></u-tabbar></view>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default {
		data() {
			return {
				list:["欢迎使用超市课程管理系统"],
			}
		},
		onLoad() { //option为object类型，会序列化上个页面传递的参数
		    this.$store.commit('setRoleId',2)
		},
		computed: {
			...mapState(['tabBerList',])
		},
		methods: {
			topage(e){
				if(e=='buyreport'){
					uni.navigateTo({
						url:'/pages/buyer/buy-commodity/'+e
					})
				}else{
					uni.navigateTo({
						url:'/pages/public/homepage/'+e
					})
				}
			},
			tosup(){
				uni.navigateTo({
					url:'/pages/public/supplie/supment'
				})
			},
			tostock(){
				uni.navigateTo({
					url:'/pages/public/stock/stoctlist'
				})
			},
			towar(){
				uni.navigateTo({
					url:'/pages/public/warehouse/warment?type=1'
				})
			},
		}
	}
</script>

<style lang="scss">
	.canvas {
		width: 100px;
		height: 100px;
	}
	.wrap {
		padding: 15rpx;
	}
	.bbody {
		margin-top: 10px;
		background: #FFF;
		margin-left:10rpx;
		margin-right: 10rpx;
		box-shadow: 0px 0px 28rpx 1rpx rgba(78, 101, 153, 0.14);
		border-radius: 15rpx;
		.grid-text {
			font-size: 30rpx;
			color: #444;
			padding: 10rpx 0 10rpx 0rpx;
			box-sizing: border-box;
		}
	}
</style>
